/*
	© Simone Esposito - 2013
*/

using UnityEngine;
using System.Collections;

public class Wheel : MonoBehaviour {
	public WheelCollider col;
	public float rotation;
	public float isSteer;
	
	void LateUpdate()
	{
		// rotate wheel, x axis for spinning, y for steer angle if isSteer is true
		rotation = ( rotation + col.rpm * col.radius * 6.28f * Time.deltaTime ) % 360.0f;
		transform.localRotation = Quaternion.Euler( rotation, col.steerAngle*isSteer, 0.0f );
	}
}